package com.example.joke.base

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.viewbinding.ViewBinding

abstract class BaseActivity<V : ViewBinding> : AppCompatActivity() {

    protected lateinit var binding: V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = getBinding1()
        setContentView(binding.root)

        initTitle()

        initData()

        setListener()
    }

    abstract fun setListener()

    abstract fun initData()

    abstract fun initTitle()

    protected abstract fun getBinding1(): V
}